package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @RequestMapping("hello")
    public BaseRespVo hello() {
        System.out.println("hello");
        return BaseRespVo.ok();
    }
    @RequestMapping("hello/{name}")
    public BaseRespVo hello(@PathVariable("name") String name) {
        System.out.println("hello " + name);
        return BaseRespVo.ok(name);
    }

    @RequestMapping("goodbye/{name}")
    public BaseRespVo goodbye(@PathVariable("name") String name) {
        System.out.println("byebye " + name);
        return BaseRespVo.ok(name);
    }
}
